<%@ include file="/WEB-INF/jsp/includes/include.jsp" %>

<table width="60%" border="1" align="center" cellpadding="2" cellspacing="0">
	<c:if test="${groups != null}">
		<c:forEach items="${groups}" var="group">

			<c:url scope="page" value="/group/profile.html" var="groupProfileURL">
				<c:param name="id" value="${group.id}"/>
			</c:url>
			<c:url scope="page" value="/group/joingroup.html" var="joinGroupURL">
				<c:param name="id" value="${group.id}"/>
			</c:url>
			<c:url scope="page" value="/group/leavegroup.html" var="leaveGroupURL">
				<c:param name="id" value="${group.id}"/>
			</c:url>
			<c:url scope="page" value="/messageboard/postmessage.html" var="postMessageURL">
				<c:param name="id" value="${group.id}"/>
			</c:url>
			<c:url scope="page" value="/getImage.do" var="groupImg">
				<c:param name="imgsrc" value="${group.imgSrc}"/>
			</c:url>


			<tr>
				<td width="10%">
		        	<table width="100%" border="1">
		            	<tr>
		                	<td>
		                		<a href="${groupProfileURL}">
									<img src="${groupImg}" width="100" alt="${group.name}" border="0"/>
								</a>	                	
		                	</td>
		                </tr>
		            </table>
		        </td>
				<td width="75%">
		        	<table width="100%" border="1">
		            	<tr>
		                	<td colspan="2" align="center">
		                		<a href="${groupProfileURL}">
		                			${group.name}
		                		</a>
		                	</td>
		                </tr>
		                <tr>
		                	<td width="50%">
		                    	<table width="100%" border="1">
		                        	<tr>
		                            	<th width="100%">Network Info</th>
		                            </tr>
		                        	<tr>
		                            	<td width="100%">#Users: ${group.userNetworkSize}</td>
		                            </tr>
		                        	<tr>
		                            	<td width="100%">#Projects: ${group.projectNetworkSize}</td>
		                            </tr>
		                        	<tr>
		                            	<td width="100%">#Groups: ${group.groupNetworkSize}</td>
		                            </tr>
		                        	<tr>
		                            	<td width="100%">#Organisations: ${group.organisationNetworkSize}</td>
		                            </tr>
		                        </table>
		                    </td>
		                    <td width="50%" valign="top">
		                    	<table width="100%" border="1">
		                        	<tr>
		                            	<th width="100%">Skills Info</td>
		                            </tr>
		                            <c:forEach items="${group.skills}" var="skill">
		                            	<tr>
		                            		<td width="100%">${skill.name}</td>
		                            	</tr>
		                            </c:forEach>
		                        	<tr>
		                            	<td width="100%">Woodwork</td>
		                            </tr>
		                        </table>
		                    </td>
		                </tr>
		            </table>
		        </td>
				<td width="15%">
		        	<table width="100%" border="1">
		        		<tr>
		        			<td>
		        				<a href="${joinGroupURL}">
		        					Join group
		        				</a>
		        			</td>
		        		</tr>
		        		<tr>
	        				<td>
								<a href="${postMessageURL}">			        				
	        						Post a message
	        					</a>
	        				</td>
		        		</tr>
		        	</table>
		        </td>
		    </tr>
		</c:forEach>
	</c:if>	    
</table>
